package com.zc.study.designPattern.行为型设计模式.InterpreterPattern;

/**
 * And解释器:非终结符表达式
 */
public class AndNode extends AbstractNode{
    private AbstractNode left;//and的左表达式
    private  AbstractNode right;//and的右表达式

    public AndNode(AbstractNode left, AbstractNode right) {
        this.left = left;
        this.right = right;
    }
//and表达式的解释操作
    @Override
    public String interpret() {
        return left.interpret()+"再"+right.interpret();
    }
}
